package com.shopnight.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import lombok.Data;

/**
 * 
 * @TableName ranked_prize
 */
@TableName(value ="ranked_prize")
@Data
public class RankedPrize implements Serializable {
    /**
     * 主键
     */
    @TableId
    private Integer prizeId;

    /**
     * 奖品类型 1商品 2优惠价
     */
    private Integer prizeType;

    /**
     * 奖励资产 （商品id 或 优惠券批次id）
     */
    private Integer prizeProperty;

    /**
     * 消费排名
     */
    private Integer consumerRanked;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        RankedPrize other = (RankedPrize) that;
        return (this.getPrizeId() == null ? other.getPrizeId() == null : this.getPrizeId().equals(other.getPrizeId()))
            && (this.getPrizeType() == null ? other.getPrizeType() == null : this.getPrizeType().equals(other.getPrizeType()))
            && (this.getPrizeProperty() == null ? other.getPrizeProperty() == null : this.getPrizeProperty().equals(other.getPrizeProperty()))
            && (this.getConsumerRanked() == null ? other.getConsumerRanked() == null : this.getConsumerRanked().equals(other.getConsumerRanked()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getPrizeId() == null) ? 0 : getPrizeId().hashCode());
        result = prime * result + ((getPrizeType() == null) ? 0 : getPrizeType().hashCode());
        result = prime * result + ((getPrizeProperty() == null) ? 0 : getPrizeProperty().hashCode());
        result = prime * result + ((getConsumerRanked() == null) ? 0 : getConsumerRanked().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", prizeId=").append(prizeId);
        sb.append(", prizeType=").append(prizeType);
        sb.append(", prizeProperty=").append(prizeProperty);
        sb.append(", consumerRanked=").append(consumerRanked);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}